package com.xindz.hgq.database.greendao.bean;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;

import java.io.Serializable;
import java.util.Date;


/**
 * @name HGQBase
 * @class name：com.xindz.hgq.database.greendao.bean
 * @describe describe
 * @anthor XINDZ
 * @time 2018/5/14 17:22
 * @change
 * @chang time
 * @class describe
 */
@Entity(active = true, nameInDb = "_User")
public class User implements Serializable {

    private static final long serialVersionUID = 1609084006451007082L;
    @Id
    @Property(nameInDb = "objecId")
    private String objecId;
    @Property(nameInDb = "username")
    private String username;
    @Property(nameInDb = "sex")
    private Integer sex;
    @Property(nameInDb = "birthday")
    private Date birthday;
    @Property(nameInDb = "avatar")
    private String avatar;
    @Property(nameInDb = "mobilePhoneNumber")
    private String mobilePhoneNumber;
    @Property(nameInDb = "mobilePhoneVerified")
    private Boolean mobilePhoneVerified;
    @Property(nameInDb = "createdAt")
    private Date createdAt;
    /**
     * Used to resolve relations
     */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /**
     * Used for active entity operations.
     */
    @Generated(hash = 1507654846)
    private transient UserDao myDao;

    @Generated(hash = 1496285367)
    public User(String objecId, String username, Integer sex, Date birthday, String avatar,
            String mobilePhoneNumber, Boolean mobilePhoneVerified, Date createdAt) {
        this.objecId = objecId;
        this.username = username;
        this.sex = sex;
        this.birthday = birthday;
        this.avatar = avatar;
        this.mobilePhoneNumber = mobilePhoneNumber;
        this.mobilePhoneVerified = mobilePhoneVerified;
        this.createdAt = createdAt;
    }

    @Generated(hash = 586692638)
    public User() {
    }

    @Override
    public String toString() {
        return "User{" +
                "objecId='" + objecId + '\'' +
                ", username='" + username + '\'' +
                ", sex=" + sex +
                ", mobilePhoneVerified=" + mobilePhoneVerified +
                '}';
    }

    public String getObjecId() {
        return this.objecId;
    }

    public void setObjecId(String objecId) {
        this.objecId = objecId;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getSex() {
        return this.sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return this.birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getMobilePhoneNumber() {
        return this.mobilePhoneNumber;
    }

    public void setMobilePhoneNumber(String mobilePhoneNumber) {
        this.mobilePhoneNumber = mobilePhoneNumber;
    }

    public Date getCreatedAt() {
        return this.createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    public Boolean getMobilePhoneVerified() {
        return this.mobilePhoneVerified;
    }

    public void setMobilePhoneVerified(Boolean mobilePhoneVerified) {
        this.mobilePhoneVerified = mobilePhoneVerified;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 2059241980)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getUserDao() : null;
    }
}
